1. Field of the Invention
The present invention relates to a memory control method and an apparatus, more particularly, a memory control method for serially storing pieces of record information on events in a memory of a predetermined size and, when the memory becomes full, storing the record information on a new event at the address at which the oldest record information is stored or at an apparently vacant address where the record information which has proved to be unnecessary as a result of reference is stored. The present invention also relates to an apparatus used for such a memory control method.
2. Description of the Related Art
In a cellular mobile phone system, a service area is minutely divided into a plurality of cells (radio zones) 1.sub.1, 1.sub.2, 1.sub.3, . . . , and one radio base station 2.sub.1, 2.sub.2, 2.sub.3, . . . is provided in each cell, as shown in FIG. 13. On radio line-control station (not shown) is provided in each group of several radio base stations, and each radio line-control station is connected to a mobile telephone exchange 3 which is connected, in turn, to a telephone exchange 4 of a public telephone network. In such a cellular mobile phone system, the radio base station for receiving the electric wave is sequentially switched over to another radio base station with the movement of a portable telephone terminal 5 or a mobile telephone terminal 6 so as to enable communication with a fixed indoor telephone 7 or another mobile telephone. Thus, not only communication in a wide range but also an increase in the number of channels and an infinite increase in the number of lines are possible.
A monitor for monitoring an abnormality in a line, equipment, machine or the like is provided in each radio base station, and each monitor transmits abnormality information (alarm information) to the monitor of a predetermined master station (e.g., radio line-control station) by radio. The monitor of the master station collects alarm information from each radio base station, and stores the record of each alarm information into a memory of a predetermined size.
As shown in FIG. 14, record information includes (1) the time at which an alarm is produced, (2) the kind of the alarm, (3) the rank of the alarm, etc. The rank of the alarm is a value indicating the degree of importance of the alarm, i.e., whether or not the alarm influences the line. Although the rank is indicated only by two levels "1" and "0" in FIG. 14, the number of levels may be increased.
A memory MEM for storing record information has a capacity for storing a predetermined number N of pieces of record information so as to constantly store the latest N pieces of record information. In the memory MEM shown in FIG. 14, the maximum number of pieces of record information stored therein is set at seven (N=7) so as to simplify explanation, but a general memory actually can store a considerable number of pieces of record information.
In order to store (arrange) record information into the memory MEM, one block (composed of a plurality of addresses) of the memory MEM is allotted to one piece of record information, and plural pieces of record information are stored in the corresponding blocks. In other words, the plural pieces of record information are serially written in the order of production in the blocks whose addresses increase from the smallest address in turn, and when the memory becomes full, the oldest record information stored in the block having the smallest address is replaced by new record information. When another new piece of record information is produced, it is stored in the block having the next address in place of the old record information stored therein. In this way, the latest N pieces of record information are constantly stored in the memory MEM.
The monitor of each master station transmits the record information having a high alarm rank (rank=1) among the stored record information to a host centralized monitor at a regular interval of time (e.g., 1 minute). The centralized monitor collects the transmitted record information, and a maintenance man maintains the mobile radio system on the basis of the record information. The monitor of the master station transmits record information having a low rank when it is requested by the centralized monitor.
After the monitor of the master station transmits record information to the centralized monitor, it stores new record information in the vacant block in which the record information transmitted has been stored. In other words, when record information is transmitted to a host centralized monitor, the remaining pieces of record information are moved upward, and new pieces of record information are serially stored in the thus-produced vacant blocks.
FIGS. 15 and 16 are explanatory views of a conventional memory control method.
When plural pieces of record information are serially written in the order of production in the blocks whose addresses increase from the smallest address in turn and the memory MEM becomes full, the oldest record information stored in the block is replaced by new record information. In this way, the latest N pieces of record information are constantly stored in the memory MEM (State 1 in FIG. 15(a)).
In this state, when the record information of an alarm rank 1 is retrieved and transmitted to a host centralized monitor, the blocks of the block addresses "001", "011", "100" and "110" become vacant (State 2 in FIG. 15(b)). The monitor then serially move the record information upward in the memory MEM. As a result, the blocks of the block addresses "100" and thereafter become vacant (State 3 in FIG. 15(c)). Record information of a high alarm rank is retrieved by reference to the record information at all block addresses.
When a new alarm is produced, the record information on the alarm is stored in the block of the block address "100" (State 4 in FIG. 16(a)). Other new pieces of record information are serially stored in the blocks of the block addresses "101" and thereafter. In this way, when the memory becomes full and another new alarm is produced, the oldest record information stored in the block having the smallest address is replaced by new record information. When another new piece of record information is produced, it is stored in the block having the next address in place of the old record information stored therein. In this way, the latest N pieces of record information are constantly stored in the memory MEM (State 5 in FIG. 16(a)).
As the memory MEM for storing record information, a non-volatile memory such as an EEP-ROM is used with due consideration of power failure. Such a non-volatile memory, however, takes much time for writing in comparison with a RAM or the like. Therefore, in a conventional memory control method, it takes a considerable time to move data (record information) in the EEP-ROM, which is necessary in order to gather vacant blocks. The larger the maximum number N of pieces of record information which is stored in the memory is, the more time is necessary for moving data.
In addition, in a conventional memory control method, since record information having a high alarm rank is retrieved by reference to the record information at all block addresses, it takes much time.
Furthermore, when a CPU executes various processing in addition to the memory control in a multiple task, since data movement and data retrieval take much time, the other processing time is shortened, which results in a reduction in the throughput.